//
//  StringWithWidth.m
//  豆瓣
//
//  Created by dlios on 15-8-22.
//  Copyright (c) 2015年 dlios. All rights reserved.
//

#import "StringWithWidth.h"

@implementation StringWithWidth

+ (CGFloat)widthWithText:(id)text height:(CGFloat)height font:(UIFont *)font{
    CGSize size = CGSizeMake(3000, height);
    CGRect rect = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil];
    return rect.size.width;
}


@end
